package com.hooper.hosp.repository;

import com.hooper.hosp.model.hosp.Department;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Tim Hooper
 * @version 1.0
 * @time 2022/09/28/15:01
 */
@Repository
public interface DepartmentRepository extends MongoRepository<Department,String> {

    /**
     *  get the department by the following params
     * @param depcode department cod
     * @param hoscode the hosp code
     * @return
     */
    Department findDepartmentByDepcodeAndHoscode(String depcode, String hoscode);

    /**
     * get department list by hoscode
     * @param hoscode hosp code
     * @return
     */
    List<Department> findAllByHoscode(String hoscode);

    Department findByDepcode(String depcode);

}
